package cn.kgc.spring08.advice;

import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;

/**
 * @author: mosin
 * @version: v1.0  2022/12/6
 * 自定义前置通知  编写增强的功能
 */
public class MyBeforeAdvice implements MethodBeforeAdvice {
    @Override
    public void before(Method method, Object[] args, Object target) throws Throwable {
        System.out.println("------------log日志------------");
        String name = method.getName();
        System.out.println(" method name = " + name);
        System.out.println("args[0] = " + args[0]);
        System.out.println("args[1] = " + args[1]);
    }
}
